{width=30% }


MetaFetcheR is an R package designed to link metabolites IDs from different Metabolome databases with eachother in a step to resolve ambiguity and standardize metabolites representation and annotation. Currently the package supports resolving IDs for the following databases:


Installation

  1. Install postgressql database on your system and create a user,you can download the database from here
  2. Install devtools in R
install.packages("devtools")
  1. Install MetafetcheR package
library(devtools)
devtools::load_all()
install_github("komorowskilab/metafetcher")
  1. Download the database SQL dump files
  2. HMDB
  3. ChEBI
  4. PubChem

  5. Uncompress all downloaded files in a directory you create and name it tmp

  6. Create a new R project and install MetafetcheR package

library(devtools)
devtools::load_all()
install_github("komorowskilab/metafetcher")
library(metafetcher)
  1. call write_config with the
write_config(host,port,db_name,user,password,path_of_tmp_folder)

8.call function install_database() for creating the tables and inserting the data from the tmp folder preferably put it in your R project directory

install_database() 

Example

Create a csv file with input IDs in the following format

library(knitr)
discovery=read.csv("discovery.csv")
kable(discovery,caption="example input table")
library(metafetcher)
df.res <- read.csv("discovery.csv", stringsAsFactors=FALSE)
resp <- resolve_metabolites(df.res)
print(resp$df)
df.out <- resp$df
kable(df.out ,caption="output table")

To map only a single ID you can use function resolve_single_id

library(metafetcher)
resp1 <- resolve_single_id('hmdb_id', 'HMDB0001005')

df.out1 <- resp1$df
print(df.out1)
kable(df.out1 ,caption="output table")

Citation

https://github.com/komorowskilab/metafetcher




oboforty/metafetcher documentation built on Aug. 18, 2021, 6:38 a.m.